// src/api/nav.ts
import { post, get, deleteR, patch } from "@/http/request";

// 获取导航列表
export const getNavList = async (params: any) => {
	return get<any>({}, "/nav", params);
};

// 新增导航分类
export const addNav = async (data: any) => {
	return post<any>({}, "/nav", data);
};

// 删除导航分类
export const delNav = async (id: number) => {
	return deleteR<any>({}, `/nav/${id}`);
};

// 更新导航分类
export const updateNav = async (data: any) => {
	return patch<any>({}, `/nav/${data.id}`, data);
};

// 新增导航项
export const addNavItem = async (data: any) => {
	return post<any>({}, "/nav/navItem", data);
};

// 删除导航项
export const delNavItem = async (id: number) => {
	return deleteR<any>({}, `/nav/navItem/${id}`);
};

// 更新导航项
export const updateNavItem = async (data: any) => {
	return patch<any>({}, `/nav/navItem/${data.id}`, data);
};
